#include "MyConnPool.h"

MyConnPool::MyConnPool()
{
}

MyConnPool::~MyConnPool()
{
}

void MyConnPool::Add(int conn)
{
	mtx.lock();
	MyConn c;
	c.m_conn = conn;
	m_vec.push_back(c);
	mtx.unlock();
}

void MyConnPool::deDuplicatio(std::string dev_name)
{

}

std::vector<MyConn> MyConnPool::Get()
{
	mtx.lock();
	std::vector<MyConn> v(m_vec);
	mtx.unlock();

	return v;
}

void MyConnPool::Set(std::vector<MyConn> v)
{
	mtx.lock();
	m_vec.clear();
	m_vec.assign(v.begin(), v.end());
	mtx.unlock();
}